﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Input;

namespace _03_属性通知更改.Commands;

public class MyCommand : ICommand
{
    private Action? _execute = null;
    public event EventHandler? CanExecuteChanged;

    public MyCommand(Action action) => _execute = action;
    public bool CanExecute(object? parameter) => true;

    public void Execute(object? parameter) => _execute?.Invoke();
}
